package cn.kgc.service.impl;

import cn.kgc.dao.CityDao;
import cn.kgc.entity.City;
import cn.kgc.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author mosin
 * date 2022/1/12
 * @version 1.0
 */
@Service
public class CityServiceImpl implements CityService {
    @Autowired
    private CityDao cityDao;
    @Override
    public List<City> getAll() {
       List<City> cities =  cityDao.queryAll();
        return cities;
    }

    @Override
    public City addCity(City city) {
        int line =  cityDao.insertCity(city);
        return city;
    }

    @Override
    public City getOne(Integer id) {

        City city =  cityDao.getOne(id);
        return city;
    }
}
